﻿@model IEnumerable<Developer.Entity.Borrowing>
@{
    Layout = null;
}

<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="~/Content/UI/css/mui.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="~/Content/UI/css/mdui.min.css" />
    <style>
        h5 {
            margin-bottom: 10px;
        }

        img {
            width: 50%;
            float: left;
        }

        .detail {
            width: 45%;
            float: left;
            margin-left: 5%;
        }
    </style>
</head>

<body>
    <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">待还书籍</h1>
    </header>

    <div class="mui-content" style="padding-bottom: 100px;">
        @if (Model.Count() == 0)
        {
            <div class="mui-content" style="padding-bottom: 100px;">
                <h4 class="mdui-text-center" style="margin-top: 100px;">当前没有借书哦~</h4>
            </div>
        }
        else
        {
            <ul class="mui-table-view mui-card">
                @{
                    foreach (var item in Model)
                    {
                        var country = string.Empty;
                        if (item.Book.Author.Contains('】'))
                        {
                            country = item.Book.Author.Split('】')[0];

                        }
                        else if (item.Book.Author.Contains("]"))
                        {
                            country = item.Book.Author.Split(']')[0].Split('[')[1];
                        }
                        else
                        {
                            country = item.Book.Author;
                        }
                        <li class="mui-table-view-cell mui-collapse">
                            <a class="mui-navigate-right" href="#">@(item.Book.Author.Contains('】') == true ? country + "】" + item.Book.Name : (item.Book.Author.Contains(']') == true ? "【" + country + "】"+ item.Book.Name : item.Book.Name)  )</a>
                            <div class="mui-collapse-content">
                                <a href="/book/detail?bookId=@item.BookId">
                                    <img src="@item.Book.CoverImg" class="mdui-shadow-8">
                                </a>
                                <div class="detail">
                                    <h5><strong>书名：</strong>@item.Book.Name</h5>
                                    <h5><strong>作者：</strong>@(item.Book.Author.Contains('】') == true ? item.Book.Author.Split('】')[1] : (item.Book.Author.Contains(']') == true ? item.Book.Author.Split(']')[1] : item.Book.Author))</h5>
                                    <h5><strong>定价：</strong>@item.Book.OriginPrice￥</h5>
                                    <h5><strong>预定价：</strong>@item.Book.OrderPrice￥</h5>
                                    <h5><strong>ISBN：</strong>@item.Book.ISBN</h5>
                                    <h5><strong>馆存：</strong>@item.Book.BookGits.First().Remain</h5>
                                    <small><strong>借阅时间：</strong>@item.CreateTime</small>
                                </div>
                            </div>
                        </li>

                    }
                }

            </ul>

                    }

    </div>

    <script src="~/Content/UI/js/mui.min.js"></script>
    <script type="text/javascript" src="~/Content/UI/js/mdui.min.js"></script>
    <script type="text/javascript">
			mui.init()
    </script>
</body>

</html>
